package cn.kgc.flight.dao;

import cn.kgc.flight.pojo.City;
import cn.kgc.flight.pojo.Flight;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.web.bind.annotation.RequestBody;

import java.util.List;

@Mapper
public interface FlightDao {

    /*
     * 查询所有城市
     */
    List<City> queryAllCity();

    /*
     * 根据起始站查询航班信息
     */
    List<Flight> queryFlight(@Param("departureCity") Integer departureCity, @Param("arrivalCity") Integer arrivalCity);

    /*
     * 查询航班编号数量
     */
    int queryCountByFlightNo(@Param("flightNo") String flightNo);

    /*
     * 增加航班
     */
    int insertFlight(@RequestBody Flight flight);

}
